//
//  MYNewsRankCollViewTabelCell.swift
//  MuYing
//
//  Created by tbb on 2019/8/5.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class MYNewsRankCollViewTabelCell: YQTableViewBaseCell {

    @objc lazy var starRateView: GBStarRateView = {
        let starRateView = GBStarRateView(frame: CGRect(x: 0, y: 0, width: 76, height: 12));
        if kSwiftkScreenSizeWidth == 320 {
            starRateView.frame = CGRect(x: 0, y: 0, width: 68, height: 12);
            starRateView.spacingBetweenStars = 2;
        }else{
            starRateView.spacingBetweenStars = 4;
        }
        //starRateView.backgroundColor = UIColor.red;
        starRateView.starSize = CGSize(width: 12, height: 12);
        starRateView.style = .incompleteStar;
        starRateView.allowClickScore = false;
        starRateView.numberOfStars = 5;
        starRateView.currentStarRate = 5.0;
        return starRateView;
    }()
    
    @objc @IBOutlet weak var lineView: UIView!
    @objc @IBOutlet weak var rankBtn: UIButton!
    @objc @IBOutlet weak var goodsIcon: UIImageView!
    @objc @IBOutlet weak var goodsTitleLb: UILabel!
    @objc @IBOutlet weak var commentCountLb: UILabel!
    
    @objc @IBOutlet weak var detailsBtn: QMUIGhostButton!
    
    @IBOutlet weak var bgView: UIView!
    
    @IBOutlet weak var imageWConst: NSLayoutConstraint!
    
    @IBOutlet weak var imageHConst: NSLayoutConstraint!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.detailsBtn.setTitle(kYQLSSwift("详情"), for: .normal);
        self.detailsBtn.ghostColor = appThemeColor;
        self.detailsBtn.isEnabled = false;
        self.goodsIcon.layer.cornerRadius = 8;
        self.goodsIcon.clipsToBounds = true;
    }
    
    override func layoutSubviews() {
        super.layoutSubviews();
        if kSwiftkScreenSizeWidth == 320 {
            self.imageWConst.constant = 54;
            self.imageHConst.constant = 54;
        }
        self.bgView.addSubview(self.starRateView);

    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}

